package main

import (
	"fmt"
	"project-deploy-service/models"
	"project-deploy-service/redis"
	"project-deploy-service/router"
	"project-deploy-service/utils"
)

var config models.Config

func main() {
	config = utils.FileUtil.LoadConfig()
	redis.InitRedis.Start()
	// 从配置中获取端口和主机
	serverAddr := fmt.Sprintf("%s:%d", config.Server.Host, config.Server.Port)
	r := router.SetupRouter()
	err := r.Run(serverAddr)
	if err != nil {
		return
	}
}
